﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<title>S_GetLineStrの使用例</title>
<LINK REL="stylesheet" TYPE="text/css" HREF="../sakura.css">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
</head>
<body>
<small>
Sakura-Editor Macro Reference
</small>
<h2>S_GetLineStrの使用例</h2>

<pre>
<span style="color:green;">//sample.js
//指定論理行の取得</span>
<span style="color:blue;">var</span> oWsh = <span style="color:blue;">new</span> ActiveXObject(<span style="color:#800000;">"WScript.Shell"</span>);
<span style="color:blue;">var</span> sBuf;

sBuf = <span style="color:#800000;">"先頭行の内容は\n"</span> + <span style="color:blue;">GetLineStr</span>(<span style="color:red;">1</span>) + <span style="color:#800000;">"\n\n"</span>;
sBuf += <span style="color:#800000;">"現在キャレット行の内容は\n"</span> + <span style="color:blue;">GetLineStr</span>(<span style="color:red;">0</span>) + <span style="color:#800000;">"\n\n"</span>;
sBuf += <span style="color:#800000;">"最終行の内容は\n"</span> + <span style="color:blue;">GetLineStr</span>(<span style="color:blue;">GetLineCount</span>(<span style="color:red;">0</span>));

oWsh.Popup(sBuf, <span style="color:red;">0</span>, <span style="color:#800000;">"行を取得"</span>, <span style="color:red;">0</span>);
</pre>

<pre>
<span style="color:green;">//sample.ppa</span>
<span style="color:blue;">MessageBox</span>(<span style="color:blue;">S_GetLineStr</span>(<span style="color:red;">0</span>), <span style="color:#800000;">'現在行の文字列'</span>, <span style="color:red;">0</span>);
</pre>
<hr>
</body></html>
